﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.ETL.Domain.TaskRuntime
{
    public class DateScriptObj
    {
        private DateTime _dateTime;

        public DateScriptObj Now()
        {
            this._dateTime = DateTime.Now;
            return this;
        }

        public DateScriptObj AddDays(int days)
        {
            this._dateTime = this._dateTime.AddDays(days);
            return this;
        }

        public DateScriptObj AddMonths(int days)
        {
            this._dateTime = this._dateTime.AddMonths(days);
            return this;
        }

        public DateScriptObj AddYears(int days)
        {
            this._dateTime = this._dateTime.AddYears(days);
            return this;
        }

        public string ToString(string format)
        {
            if(string.IsNullOrEmpty(format))
            {
                return this._dateTime.ToString();
            }
            return this._dateTime.ToString(format);
        }

        public override string ToString()
        {
            return this._dateTime.ToString();
        }
    }
}
